<?php 
	require_once('./include/cache_start.php');
	include_once("maincore.php");
?>
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
	<link rel=stylesheet href='./include/hoj.css' type='text/css'>

</head>
<body>
<div id=head>
<h2><img id=logo src=./image/logo.png><span id="red">
<?php
if (isset($_SESSION['user_id'])) {
$sql = "select title from organ where user_id='".$_SESSION['user_id']."' or user_id='".$_SESSION['user_reference']."' order by organ_id desc Limit 1";
$result = mysql_query($sql);
if (mysql_num_rows($result))
{
	$row=mysql_fetch_row($result);
	echo $row[0];
}
else 
{
	echo "CHẤM THI TRỰC TUYẾN - VERSION 1.0 - 12/10/2011";
}
?>
</span></h2>
</div><!--end head-->
<br/>
<div id=subhead>
<div id=menu >
		<?php 
			$url=basename($_SERVER['REQUEST_URI']);
			//echo $url;
		
		?>
		<div class=menu_item >
		[<a href="<?php echo $OJ_HOME?>"><span style='color:orange'>Trang chủ</span></a>]
		</div>
		<div class=menu_item >
		[<a href="bbs.php"><?php if ($url==$OJ_BBS.".php") echo "<span style='color:orange'>";?>
		Trao đổi<?php if ($url==$OJ_BBS.".php") echo "</span>";?></a>]
		</div>
		<!--
		<div class=menu_item >
		[<a href="problemset.php"><?php if ($url=="problemset.php") echo "<span style='color:orange'>";?>
		<?php echo $MSG_PROBLEMS?><?php if ($url=="problemset.php") echo "</span>";?></a>]
		</div>
		-->
		<div class=menu_item >
		[<a href="status.php"><?php if ($url=="status.php") echo "<span style='color:orange'>";?>
		Kết quả<?php if ($url=="status.php") echo "</span>";?></a>]
		</div>
		<!--
		<div class=menu_item >
		<a href="ranklist.php"><?php if ($url=="ranklist.php") echo "<span style='color:orange'>";?>
		<?php echo $MSG_RANKLIST?><?php if ($url=="ranklist.php") echo "</span>";?></a>
		</div>
		-->
		<div class=menu_item >
		[<a href="contest.php"><?php if ($url=="contest.php") echo "<span style='color:orange'>";?>
		Vào thi<?php if ($url=="contest.php") echo "</span>";?></a>]
		</div>
		
		<div class=menu_item ><?php if ($url==isset($OJ_FAQ_LINK)?$OJ_FAQ_LINK:"faqs.php") echo "<span style='color:orange'>";?>
		[<a href="<?php echo isset($OJ_FAQ_LINK)?$OJ_FAQ_LINK:"faqs.php"?>">Hỏi đáp<?php if ($url==isset($OJ_FAQ_LINK)?$OJ_FAQ_LINK:"faqs.php") echo "</span>";?></a>]
		</div>
		<?php if(isset($OJ_DICT)&&$OJ_DICT&&$OJ_LANG=="cn"){?>
      <div class=menu_item >
		      <span style="color:1a5cc8" id="dict_status"></span>
      </div>
      <script src="include/underlineTranslation.js" type="text/javascript"></script> 
      <script type="text/javascript">dictInit();</script> 
		<?php }?>
</div><!--end menu-->
<div id=profile >
<script src="include/profile.php" ></script>
</div><!--end profile-->
</div><!--end subhead-->

<?php } 
	else
	{
	echo "CHẤM THI TRỰC TUYẾN - VERSION 1.0 - 12/10/2011";
	echo '<div id=profile >
	<script src="include/profile.php" ></script>
	</div>';
	}
	echo "<marquee id=broadcast scrollamount=1 direction=up scrolldelay=250 onMouseOver='this.stop()' onMouseOut='this.start()';>";
	if($OJ_SAE&&$OJ_MEMCACHE){
		$mem = new Memcache;
    	$mem=memcache_init();
    	echo $mem->get("msg");
        	
    }else{
		require('./admin/msg.txt');
	}
	echo "</marquee>";
?>


<div id=main>
